/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package facades;

import entities.Notificacion;
import entities.Usuario;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author damfercer
 */
@Stateless
public class NotificacionFacade extends AbstractFacade<Notificacion> {
    @PersistenceContext(unitName = "CorporatePU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public NotificacionFacade() {
        super(Notificacion.class);
    }
    
    public List<Notificacion> getMultiplicadorDeCategoriaYSexo(Usuario u){
        Query q=em.createNamedQuery("Notificacion.findByUsuario");
        q.setParameter("idUsuario", u.getIdUsuario());
        return q.getResultList();
    }
}
